package com.pengli.mytools.ui.mainPage.mine;

import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;

import com.pengli.mytools.R;
import com.pengli.mytools.beans.po.URLData;
import com.pengli.mytools.retrofit.NetConstant;
import com.pengli.mytools.ui.SettingActivity;
import com.pengli.mytools.ui.webView.MyWebViewActivity;
import com.pengli.mytools.views.dialog.MyPopDialog;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class MineFragment extends Fragment {

    private Context context;

    public View onCreateView(@NonNull LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_mine, container, false);
        ButterKnife.bind(this, root);
        context = getActivity();
        return root;
    }


    @OnClick({R.id.baiduyun_cfg, R.id.check_update, R.id.popularize, R.id.setting})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.baiduyun_cfg:
                Intent intent1 = new Intent(context, BaiduYunConfigActivity.class);
                startActivity(intent1);
                break;

            case R.id.setting:
                Intent intent2 = new Intent(context, SettingActivity.class);
                startActivity(intent2);
                break;
            case R.id.popularize:
                MyPopDialog dialog2 = new MyPopDialog(context, R.layout.dialog_popularize);
                dialog2.show();

                break;
            case R.id.check_update:
                if (true) {
                    // 非wifi网络下，再次提示用户是否继续

                    MyPopDialog dialog = new MyPopDialog(context, R.layout.dialog_update);
                    dialog.show();


                }
                break;
        }
    }
}